module.exports = {
    seconds: 0,
    timerId: 0,
    callback: null,
    start: function(t, s) {
        var i = this;
        this.callback = t, this.timerId || (this.timerId = setInterval(function() {
            i.seconds++, i.callback.call(null, i.seconds);
        }, 1e3));
    },
    stop: function() {
        this.seconds = 0, clearInterval(this.timerId), this.timerId = 0;
    },
    isRunning: function() {
        return 0 != this.timerId;
    }
};